var t = getApp();

Page({
    data: {
        inviteDesc: "成功邀请10人 赠送7日vip 可无限叠加，邀请99人，赠送一年vip。",
        inviteNum: "邀请列表",
        emptyText: "正在加载...",
        inviteJiaoCheng: "",
        users: [],
        shareDict: {}
    },
    loadData: function(a) {
        var e = this;
        t.network.post({
            url: t.url.GetInviteRegisterUserList,
            params: {},
            before: function() {
                wx.showNavigationBarLoading();
            },
            success: function(a) {
                1 == a.data.result ? e.setData({
                    inviteDesc: a.data.data.inviteDesc,
                    users: a.data.data.users,
                    inviteNum: a.data.data.inviteNum,
                    inviteJiaoCheng: a.data.data.inviteJiaoCheng,
                    emptyText: "暂无邀请成功记录"
                }) : t.util.showToast(a.data.message);
            },
            fail: function() {
                t.util.showToast("获取数据失败");
            },
            complete: function() {
                wx.hideNavigationBarLoading();
            }
        });
    },
    loadShareData: function(a) {
        var e = this;
        t.network.post({
            url: t.url.GetInviteRegisterInfo,
            params: {},
            before: function() {},
            success: function(a) {
                1 == a.data.result ? e.setData({
                    shareDict: a.data.data
                }) : t.util.showToast(a.data.message);
            },
            fail: function() {
                t.util.showToast("获取邀请数据失败");
            },
            complete: function() {}
        });
    },
    tapItem: function(a) {
        var e = a.currentTarget.dataset.accesstoken;
        t.util.navToUserHome(e);
    },
    onLoad: function(t) {
        this.loadData(), this.loadShareData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            title: this.data.shareDict.title,
            path: this.data.shareDict.path,
            imageUrl: this.data.shareDict.image,
            success: function(t) {},
            fail: function(t) {}
        };
    }
});